package dto

// RoleQueryParams 角色查询参数
type RoleQueryParams struct {
	Page     int    `form:"page" binding:"required,min=1"`
	PageSize int    `form:"pageSize" binding:"required,min=1,max=100"`
	Name     string `form:"name"`
	Code     string `form:"code"`
	Status   *int8  `form:"status"`
}

// RoleCreateRequest 创建角色请求
type RoleCreateRequest struct {
	Name        string `json:"name" binding:"required,min=2,max=50"`
	Code        string `json:"code" binding:"required,min=2,max=50"`
	Sort        int    `json:"sort"`
	Status      int8   `json:"status" binding:"omitempty,oneof=0 1"`
	Remark      string `json:"remark"`
	ResourceIDs []uint `json:"resourceIds"`
}

// RoleUpdateRequest 更新角色请求
type RoleUpdateRequest struct {
	Name        string `json:"name" binding:"omitempty,min=2,max=50"`
	Code        string `json:"code" binding:"omitempty,min=2,max=50"`
	Sort        int    `json:"sort"`
	Status      int8   `json:"status" binding:"omitempty,oneof=0 1"`
	Remark      string `json:"remark"`
	ResourceIDs []uint `json:"resourceIds"`
}

// RoleResourceRequest 角色资源分配请求
type RoleResourceRequest struct {
	ResourceIDs []uint `json:"resourceIds" binding:"required"`
}
